package com.ruoyi.fantasy.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fantasy.mapper.FantasyBankAccountFlowMapper;
import com.huanzhidadi.fantasy.bean.domain.FantasyBankAccountFlow;
import com.ruoyi.fantasy.service.IFantasyBankAccountFlowService;
import com.ruoyi.common.core.text.Convert;

/**
 * 账户流水Service业务层处理
 * 
 * @author wanghui
 * @date 2020-06-18
 */
@Service
public class FantasyBankAccountFlowServiceImpl implements IFantasyBankAccountFlowService 
{
    @Autowired
    private FantasyBankAccountFlowMapper fantasyBankAccountFlowMapper;

    /**
     * 查询账户流水
     * 
     * @param id 账户流水ID
     * @return 账户流水
     */
    @Override
    public FantasyBankAccountFlow selectFantasyBankAccountFlowById(String id)
    {
        return fantasyBankAccountFlowMapper.selectFantasyBankAccountFlowById(id);
    }

    /**
     * 查询账户流水列表
     * 
     * @param fantasyBankAccountFlow 账户流水
     * @return 账户流水
     */
    @Override
    public List<FantasyBankAccountFlow> selectFantasyBankAccountFlowList(FantasyBankAccountFlow fantasyBankAccountFlow)
    {
        return fantasyBankAccountFlowMapper.selectFantasyBankAccountFlowList(fantasyBankAccountFlow);
    }

    /**
     * 新增账户流水
     * 
     * @param fantasyBankAccountFlow 账户流水
     * @return 结果
     */
    @Override
    public int insertFantasyBankAccountFlow(FantasyBankAccountFlow fantasyBankAccountFlow)
    {
        fantasyBankAccountFlow.setCreateTime(DateUtils.getNowDate());
        return fantasyBankAccountFlowMapper.insertFantasyBankAccountFlow(fantasyBankAccountFlow);
    }

    /**
     * 修改账户流水
     * 
     * @param fantasyBankAccountFlow 账户流水
     * @return 结果
     */
    @Override
    public int updateFantasyBankAccountFlow(FantasyBankAccountFlow fantasyBankAccountFlow)
    {
        return fantasyBankAccountFlowMapper.updateFantasyBankAccountFlow(fantasyBankAccountFlow);
    }

    /**
     * 删除账户流水对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteFantasyBankAccountFlowByIds(String ids)
    {
        return fantasyBankAccountFlowMapper.deleteFantasyBankAccountFlowByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除账户流水信息
     * 
     * @param id 账户流水ID
     * @return 结果
     */
    @Override
    public int deleteFantasyBankAccountFlowById(String id)
    {
        return fantasyBankAccountFlowMapper.deleteFantasyBankAccountFlowById(id);
    }
}
